#############
# cubeDemo configure.ac
# v0.4 - (c) Daniel Hiepler (2010-2013)



# --------------------------------
#    initialization
# --------------------------------

AC_INIT([traqDemo_tag], 
		m4_esyscmd([./version --short]),
        [http://code.google.com/p/lasertraq/issues],
        [traqDemo_tag],
        [http://lasertraq.googlecode.com])
AC_COPYRIGHT([Copyright (C) 2002-2013 Daniel Hiepler])        

AC_CANONICAL_SYSTEM
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.11 color-tests dist-bzip2 tar-ustar parallel-tests silent-rules -Wno-portability -Wall])




# --------------------------------
#    information on the package
# --------------------------------
# infos
PACKAGE_DESCRIPTION="graffiti tagging demo"
PACKAGE_DESCRIPTION_LONG="use the mouse to produce dripping tags"

AC_SUBST([PACKAGE_DESCRIPTION], [${PACKAGE_DESCRIPTION}], [package description])
AC_SUBST([PACKAGE_DESCRIPTION_LONG], [${PACKAGE_DESCRIPTION_LONG}], [long package description])
AC_DEFINE_UNQUOTED(PACKAGE_DESCRIPTION, "${PACKAGE_DESCRIPTION}", [package description])
AC_DEFINE_UNQUOTED(PACKAGE_DESCRIPTION_LONG, "${PACKAGE_DESCRIPTION_LONG}", [long package description])

# versioning (s. version script)
AC_SUBST([PACKAGE_MAJOR_VERSION], m4_esyscmd([./version --major]), [major version])
AC_SUBST([PACKAGE_MINOR_VERSION], m4_esyscmd([./version --minor]), [minor version])
AC_SUBST([PACKAGE_MICRO_VERSION], m4_esyscmd([./version --micro]), [micro version])
AC_SUBST([PACKAGE_GIT_VERSION], m4_esyscmd([./version --git]), [git version])

AC_PATH_PROG(DATE,date)
if test -z "$ac_cv_path_DATE" ; then
    AC_MSG_ERROR(** \"date\" not found. Can't determine build-date.)
    AC_SUBST(PACKAGE_BUILD_DATE, unknown)
else
    AC_SUBST(PACKAGE_BUILD_DATE, `date +"%d-%m-%y [%H:%M:%S %Z]"`)
    AC_MSG_NOTICE(Build date: $PACKAGE_BUILD_DATE)
fi

AC_DEFINE_UNQUOTED(PACKAGE_MAJOR_VERSION, "${PACKAGE_MAJOR_VERSION}", [major version])
AC_DEFINE_UNQUOTED(PACKAGE_MINOR_VERSION, "${PACKAGE_MINOR_VERSION}", [minor version])
AC_DEFINE_UNQUOTED(PACKAGE_MICRO_VERSION, "${PACKAGE_MICRO_VERSION}", [micro version])
AC_DEFINE_UNQUOTED(PACKAGE_GIT_VERSION, "${PACKAGE_GIT_VERSION}", [git revision])
AC_DEFINE_UNQUOTED(PACKAGE_BUILD_DATE, "${PACKAGE_BUILD_DATE}", [build date])
         

# --------------------------------
#    checks for programs
# --------------------------------
AC_PROG_CC_STDC
AM_PROG_CC_C_O
AC_HEADER_STDC
AM_PATH_GLIB_2_0

PKG_PROG_PKG_CONFIG([0.14])
if test -z "${PKG_CONFIG}"; then
  AC_MSG_ERROR([*** pkg-config not found. See http://www.freedesktop.org/software/pkgconfig/ or check your distribution.])
fi

          

# --------------------------------
#    checks for libraries
# --------------------------------
# minimum versions
GTK_REQUIRED=2.2


# ---------------------
#  check for packages
# ---------------------
PKG_CHECK_MODULES(TRAQDEMO, 
[
        SDL_image
])
AC_SUBST(TRAQDEMO_CFLAGS)
AC_SUBST(TRAQDEMO_LIBS)



# --------------------------------
#    checks for header files
# --------------------------------


# --------------------------------
#    checks for types
# --------------------------------


# --------------------------------
#    checks for structures
# --------------------------------


# --------------------------------
#    checks for compiler characteristics
# --------------------------------


# --------------------------------
#    checks for library functions
# --------------------------------


# --------------------------------
#    checks for system services
# --------------------------------


# --------------------------------
#   compile process
# --------------------------------
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])



# --------------------------------
# Arguments for configure-script
# --------------------------------
AC_ARG_ENABLE(
        debug,
		AS_HELP_STRING([--enable-debug], [enable debugging, default: no]),
		[case "${enableval}" in
             yes) debug=true ;;
             no)  debug=false ;;
             *)   AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
		esac],
		[debug=false])
AM_CONDITIONAL(ENABLE_DEBUG, test x$debug = xtrue)

AC_ARG_ENABLE(
        gprof,
		AS_HELP_STRING([--enable-gprof], [enable profiling, default: no]),
		[case "${enableval}" in
             yes) debug=true ;;
             no)  debug=false ;;
             *)   AC_MSG_ERROR([bad value ${enableval} for --enable-gprof]) ;;
		esac],
		[debug=false])
AM_CONDITIONAL(ENABLE_GPROF, test x$gprof = xtrue)



# --------------------------------
# Output
# --------------------------------
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([
        Makefile
        include/Makefile
        src/Makefile
        pixmaps/Makefile
])
AC_OUTPUT



echo "
Configure summary:
    Package.....................:  ${PACKAGE_STRING}
    Description.................:  ${PACKAGE_DESCRIPTION}
    Revision....................:  ${PACKAGE_GIT_VERSION}
    URL.........................:  ${PACKAGE_URL}
    Bugreports..................:  ${PACKAGE_BUGREPORT}

    Install prefix..............:  ${prefix}
    C compiler..................:  ${CC}
    C++ compiler................:  ${CPP}
    System CFLAGS...............:  ${CFLAGS}
    System CXXFLAGS.............:  ${CXXFLAGS}
    System LDFLAGS..............:  ${LDFLAGS}
"
